package com.frinder.quartz;

import com.frinder.jobs.Job1;
import com.frinder.jobs.Job2;
import org.quartz.Scheduler;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.ApplicationArguments;
import org.springframework.boot.ApplicationRunner;
import org.springframework.stereotype.Component;

/**
 * Created by kiktech on 2017/6/2.
 */
@Component
public class Jobinitializer implements ApplicationRunner {

    @Autowired
    private Scheduler scheduler;

    @Override
    public void run(ApplicationArguments applicationArguments) throws Exception {
//        new MyJob(scheduler, "print", Job1.class, "0/5 * * * * ?").schedule();
//        new MyJob(scheduler, "read", Job2.class, "0/1 * * * * ?").schedule();
    }


}
